package com.paddyi.commons.utils;


public enum ImageSizeEnum {
    s("s", "小"),
    m("m", "中"),
    l("l", "大"),
    xl("xl", "超大"),
    el0("el0", "超大(扩展许可)"),
    vect("vect", "矢量图"),
    vect_ex("vectex", "矢量图(扩展许可)");

    public final static String enumCode = "ImageSize";
    public final static String enumName = "图片类型";

    private String code;
    private String desc;

    ImageSizeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDesc(String code) {
        for (ImageSizeEnum status : ImageSizeEnum.values()) {
            if (status.getCode().equalsIgnoreCase(code)) {
                return status.getDesc();
            }
        }
        return "";
    }

    public static ImageSizeEnum getImageSizeEnum(String code) {
        for (ImageSizeEnum status : ImageSizeEnum.values()) {
            if (status.getCode().equalsIgnoreCase(code)) {
                return status;
            }
        }
        return ImageSizeEnum.s;
    }


    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
